package com.ymm.lulutong.domain;


import com.ymm.lulutong.utils.Result;
import com.ymm.system.api.dto.PutOnCargoRequest;
import com.ymm.system.api.dto.ShipperCargoBriefResponse;
import com.ymm.system.api.dto.ShipperCargoDetailResponse;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ShipperCargoDomainService {
    /**
     * 上架货源
     */
    Result<Long> putOnCargo(PutOnCargoRequest putOnCargoRequest, Long shipperId) throws Exception;

    /**
     * 下架货源
     */
    Result<Long> pullOffCargo(Long cargoId, Long shipperId) throws Exception;

    /**
     * 查看货源详细信息
     */
    Result<ShipperCargoDetailResponse> getCargoDetailByCargoId(Long cargoId);

    /**
     * 查看在上架状态中的货源
     */
    Result<List<ShipperCargoBriefResponse>> getOnShelfCargosByShipperId(Long shipperId);

    /**
     * 查看已下架的货源
     */
    Result<List<ShipperCargoBriefResponse>> getOffShelfCargosByShipperId(Long shipperId);

    /**
     * 上传货源图片
     *
     * @param shipperId 货主Id
     * @param image     图片
     * @return 路径
     */
    Result<String> uploadCargoPhoto(Long shipperId, MultipartFile image);

    /**
     * 成功支付货源金额，修改货源状态为上架
     *
     * @param shipperId 货主Id
     * @param cargoId   货源Id
     * @return 货源Id
     */
    Result<Long> payForCargoSuccess(Long shipperId, Long cargoId) throws Exception;
}
